﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <script>
        // 数组转换为字符串 
        // 1. toString() 将我们的数组转换为字符串
        var arr = [1, 2, 44, '项羽'];

        var result = arr.toString();
        console.log(typeof result);
        console.log(result);

        // 2. join (分隔符)
        console.log(arr.join());
        console.log(arr.join('-'));
    </script>
</body>
</html>